package org.bit.lesson02;

public class Demo202 {
    public static void main(String[] args) {
        // 给线程起名字
        Thread t1 = new Thread(() -> {
            while (true) {
                System.out.println("我是一个有名字的线程");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }, "我是一个线程");
        t1.start();
    }
}
